-
Notifications
You must be signed in to change notification settings - Fork 13.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SIH: Publish Aux Global Positon #24051
base: main
Are you sure you want to change the base?
Conversation
🔎 FLASH Analysispx4_fmu-v5x [Total VM Diff: 8 byte (0 %)]
px4_fmu-v6x [Total VM Diff: 16 byte (0 %)]
Updated: 2024-12-10T14:27:34 |
3b401e2
to
a984d0d
Compare
* | ||
****************************************************************************/ | ||
/** | ||
* Simulate Aux Global Position (AGP) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Simulate Aux Global Position (AGP) | |
* Simulate Aux Global Position (AGP) in SIH |
PARAM_DEFINE_INT32(SENS_EN_AGPSIM, 0); | ||
|
||
/** | ||
* AGP failure mode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* AGP failure mode | |
* AGP failure mode (in SIH) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That param could use some more description.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I think the original objective for this simulation module is to be re-used in multiple simulators, not only SIH.
@@ -0,0 +1,202 @@ | |||
/**************************************************************************** | |||
* | |||
* Copyright (c) 2021 PX4 Development Team. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Copyright (c) 2021 PX4 Development Team. All rights reserved. | |
* Copyright (c) 2024 PX4 Development Team. All rights reserved. |
|
||
if (phase) { | ||
do { | ||
float U1 = (float)rand() / (float)RAND_MAX; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, why did you change from the static cast used in BlockRandGauss.hpp to the regular cast?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dumbly copy-pasted the SensorGpsSim
class.
I think it requires some refactoring as it's nonsense to re-declare that function in every class. I don't understand if there is was a real reason to not have a common lib.
_position_bias.zero(); | ||
} | ||
|
||
double latitude = _measured_lla.latitude_deg() + math::degrees((double)generate_wgn() * 2.0 / |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
double latitude = _measured_lla.latitude_deg() + math::degrees((double)generate_wgn() * 2.0 / | |
const double latitude = _measured_lla.latitude_deg() + math::degrees((double)generate_wgn() * 2.0 / |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and below
PRINT_MODULE_DESCRIPTION( | ||
R"DESCR_STR( | ||
### Description | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Module to simulate auxiliary global position measurements with optional failure modes for SIH simulation. |
CONSTANTS_RADIUS_OF_EARTH); | ||
double longitude = _measured_lla.longitude_deg() + math::degrees((double)generate_wgn() * 2.0 / | ||
CONSTANTS_RADIUS_OF_EARTH); | ||
double altitude = (double)(_measured_lla.altitude() + (generate_wgn() * 0.5f)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How did you come up with the scales for the noise? Maybe worth some comments. And should we maybe define the scales somewhere centrally and then also scale .eph and .epv accordingly? Such that you can simulate easily with different noise levels.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, maybe as parameters? So we can then change the noise level during the simulation.
* @group Simulator | ||
* @min 0 | ||
* @max 3 | ||
* @bit 0 Constant |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about calling it "Measurement stuck "?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I wasn't sure if "frozen", "stuck" or "constant" would be more appropriate; I can change it to "stuck" if you find it clearer
Solved Problem
I need to test Aux Global Position (AGP) in sim.
Solution
Implement SensorAgpSim to publish AGP based on groundtruth data.